﻿# -*- coding: utf-8 -*-

def time2pos(time, delay_per_beat, space_per_beat):
    return (time / delay_per_beat) * space_per_beat
    
def beat_delay(bpm):
    return 60.0/bpm
    
def clamp(low, v, hi): return max(low, min(v, hi))
